<?php
/**
 * Vynimka pristup odopreny
 * @author Tomas Srna
 * @package bakalarka
 */
class PermissionDeniedException extends Exception
{
	protected $objectName;
	
	public function __construct($text, $objectName)
	{
		
		$a = Auth::instance();
		if($text == "") $text = 'L::permissionDeniedUser;'. json_encode(
			array( ($a->isAuth() ? $a->getUser()->username : 
			L::selected()->notLoggedIn), $objectName));
		
		parent::__construct($text);
		$this->objectName = $objectName;
	}
	
	public function getObjectName()
	{
		return $this->objectName;
	}
}
